//
//  HomeTransactPersonSectionTwoCollectionViewCell.m
//  ZJControlsClass
//
//  Created by mac on 2024/11/14.
//

#import "HomeTransactPersonSectionTwoCollectionViewCell.h"

@implementation HomeTransactPersonSectionTwoCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self){
        
        [self configUI];
        
        
    }
    return self;
}



-(void)configUI{
    [self.contentView addSubview:self.follewView];
    [self.follewView addSubview:self.titleLabel];
    [self.follewView addSubview:self.rightView];
    [self.rightView addSubview:self.rightImg];
    [self.follewView addSubview:self.iconImg];
    
    
    [self.follewView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.bottom.equalTo(self.contentView);
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.follewView).with.offset(ALIGN_WIDTH_PT(8));
        make.right.equalTo(self.follewView).with.offset(-ALIGN_WIDTH_PT(8));
        make.top.equalTo(self.follewView).with.offset(ALIGN_HEIGHT_PT(14));
    }];
    
    
    [self.iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.follewView).with.offset(-ALIGN_WIDTH_PT(8));
        make.bottom.equalTo(self.follewView.mas_bottom).with.offset(-ALIGN_HEIGHT_PT(12));
        make.size.equalTo(@(CGSizeMake(ALIGN_WIDTH_PT(36), ALIGN_WIDTH_PT(36))));
    }];
    
        
    [self.rightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel.mas_left);
        make.centerY.equalTo(self.iconImg.mas_centerY);
        make.size.equalTo(@(CGSizeMake(ALIGN_WIDTH_PT(22), ALIGN_HEIGHT_PT(16))));
    }];
    [self.rightImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.rightView.mas_centerX);
        make.centerY.equalTo(self.rightView.mas_centerY);
        make.size.equalTo(@(CGSizeMake(ALIGN_WIDTH_PT(6), ALIGN_HEIGHT_PT(11))));
    }];
    
    
    
    
    
    
}

#pragma mark -- 懒加载
-(UIView *)follewView{
    if(!_follewView){
        _follewView = [UIView new];
        _follewView.backgroundColor = COLOR_RGB(233, 249, 251);
        _follewView.layer.cornerRadius = 10;
        _follewView.layer.masksToBounds = YES;
    }
    
    return _follewView;
}

-(UILabel *)titleLabel{
    if (!_titleLabel){
        _titleLabel = [UILabel new];
        _titleLabel.textColor = [UIColor blackColor];
        _titleLabel.font = [UIFont systemFontOfSize:14 weight:0.5];
        _titleLabel.textAlignment = NSTextAlignmentLeft;
        _titleLabel.text = @"单位备案";
        _titleLabel.numberOfLines = 2;
    }
    return _titleLabel;
}

-(UIView *)rightView{
    if(!_rightView){
        _rightView = [UIView new];
        _rightView.backgroundColor = [UIColor whiteColor];
        _rightView.layer.cornerRadius = 5;
        _rightView.layer.masksToBounds = YES;
    }
    
    return _rightView;
}


-(UIImageView *)rightImg{
    if (!_rightImg){
        _rightImg = [UIImageView new];
        _rightImg.image = [UIImage imageNamed:@""];
    }
    return _rightImg;
}

-(UIImageView *)iconImg{
    if (!_iconImg){
        _iconImg = [UIImageView new];
        _iconImg.image = [UIImage imageNamed:@""];
    }
    return _iconImg;
}

@end
